package servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "Servlet01", value = "/Servlet01")
public class Servlet01 extends javax.servlet.http.HttpServlet {
    //get方法
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       //0.设置响应编码
        response.setCharacterEncoding("utf-8");
        //1.获取到输出流
        PrintWriter out = response.getWriter();
        //2.使用输出流向客户端发送信息
        out.write("hello");
        out.write("8347389472984793");
        out.write("你好啊!");
    }
//Post方法
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
